import { reactive, watch } from "vue";

const storageTokenKey = "__user_token__";

const state = reactive({
  authList: [],
  token: "",
  userInfo: {},
  department: {},
});

watch(state.token, (val) => {
  window.localStorage[val ? "setItem" : "removeItem"](storageTokenKey, val);
});

return state;
